package com.lagou.edu.authority;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lagou.edu.authority.dto.AllocateRoleResourceDTO;
import com.lagou.edu.authority.dto.ResourceCategoryDTO;
import com.lagou.edu.authority.dto.ResourceDTO;
import com.lagou.edu.authority.param.ResourceQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * TODO
 *
 * @author lm
 * @since 2021/11/5 17:18
 */
@FeignClient(value = "edu-authority-boot", path = "/resource")
public interface ResourceRemoteService {
    @PostMapping("/saveOrUpdateResource")
    Boolean saveOrUpdateResource(@RequestBody ResourceDTO resourceDTO);

    @PostMapping("/getResourcePages")
    Page<ResourceDTO> getResourcePages(@RequestBody ResourceQueryParam resourceQueryParam);

    @PostMapping("/category/saveOrUpdateResourceCategory")
    public Boolean saveOrUpdateResourceCategory(@RequestBody ResourceCategoryDTO resourceCategoryDTO);

    @GetMapping("/category/getAll")
    List<ResourceCategoryDTO> getAllCategories();

    @GetMapping("/category/getById")
    ResourceDTO getResourceDTOById(@RequestParam("id") Integer id);

    @GetMapping("/getAllResource")
    List<ResourceDTO> getAllResource();

    @PostMapping("/allocateRoleResources")
    Boolean allocateRoleResources(AllocateRoleResourceDTO allocateRoleMenuDTO);
}
